<!DOCTYPE html>

<!--
Copyright 2017 Google Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<html lang="en">
<head>

<script>
//  philipwalton.com/articles/the-google-analytics-setup-i-use-on-every-site-i-build
window.ga = window.ga || function() {
  (ga.q = ga.q || []).push(arguments);
};
ga('create', 'UA-33848682-1', 'auto');
ga('set', 'transport', 'beacon');
ga('send', 'pageview');
</script>
<script async src="https://www.google-analytics.com/analytics.js"></script>

<meta charset="utf-8">
<meta name="description" content="Simplest possible examples of HTML, CSS and JavaScript.">
<meta name="author" content="//samdutton.com">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta itemprop="name" content="simpl.info: simplest possible examples of HTML, CSS and JavaScript">
<meta itemprop="image" content="/images/icons/icon192.png">
<meta id="theme-color" name="theme-color" content="#fff">

<link rel="icon" href="/images/icons/icon192.png">

<base target="_blank">


<title>RTCDataChannel</title>

<link rel="stylesheet" href="../css/main.css">

<style>
  button {
    margin: 0 1em 0 0;
    width: 5.2em;
  }
  div#buttons {
    margin: 0 0 1.7em 0;
  }
  div#send {
    float: left;
    margin: 0 3em 1em 0;
  }
  div#sendReceive {
    margin: 0 0 1em 0;
  }
  h1 {
    margin: 0 0 1em 0;
  }
  h2 {
    margin: 0 0 0.5em 0;
  }
  textarea {
    color: #444;
    font-family: 'Courier New', monospace;
    font-size: 1em;
    height: 7.0em;
    padding: 0.5em;
  }
</style>

</head>

<body>

  <div id="container">

   <!--  <div id="highlight">
      <p>New(ish) article:
        <a href="https://samdutton.wordpress.com/2018/06/04/a-manifesto-for-teaching-web-development/">A manifesto for teaching web development</a>
      </p>
    </div> -->

    <div id="highlight">
			<p>HTML, CSS and JavaScript feature support across top browsers:
			  <br><br>
			  <a href="https://bit.ly/caniuse-stuff">bit.ly/caniuse-stuff</a>
			</p>
		</div>

<!--      -->

    <h1><a href="../index.html" title="simpl.info home page">simpl.info</a> RTCDataChannel</h1>

 <!--    <p class="borderBelow">Check out the complete set of WebRTC demos at <a href="https://webrtc.github.io/samples/" title="WebRTC samples GitHub Pages">webrtc.github.io/samples</a>.</p>
 -->
    <div id="buttons">
      <button id="startButton">Start</button>
      <button id="sendButton">Send</button>
      <button id="closeButton">Stop</button>
    </div>

    <div id="sendReceive">
      <div id="send">
        <h2>Send</h2>
        <textarea id="dataChannelSend" disabled placeholder="Press Start, enter some text, then press Send."></textarea>
      </div>
      <div id="receive">
        <h2>Receive</h2>
        <textarea id="dataChannelReceive" disabled></textarea>
      </div>
    </div>

    <p>View the console to see logging.</p>

    <p>The <code>RTCPeerConnection</code> objects <code>localConnection</code> and <code>remoteConnection</code> are in global scope, so you can inspect them in the console as well.</p>
    <p>Code in this example used by kind permission of Vikas Marwaha.</p>
    <p>For more information about PeerConnection, see <a href="https://www.html5rocks.com/en/tutorials/webrtc/basics/#toc-rtcdatachannel" title="RTCDataChannel section of HTML5 Rocks article about WebRTC">Getting Started With WebRTC</a>.</p>

    <script src="js/main.js"></script>

    <a href="https://github.com/samdutton/simpl/blob/gh-pages/rtcdatachannel" title="View source for this page on GitHub" id="viewSource">View source on GitHub</a>

  </div>


</body>
</html>
